﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
using System.Threading.Tasks;
using System.Xml;

namespace Clinic.Service.HttpRequest
{

    /// <summary>
    /// Json扩展方法
    /// </summary>
    public static class JsonExtends
    {
        public static T ToEntity<T>(this string val)
        {
            return System.Text.Json.JsonSerializer.Deserialize<T>(val);
        }
        public static string ToJson<T>(this T entity)
        {
            return System.Text.Json.JsonSerializer.Serialize(entity);
        }
    }
}
